using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;


namespace Acms.SqlDal
{
    public class UserPostVoteAverageDal : Base
    {
        public enum Fields
        {
            PostId,
            Average
        }

        protected override void ReadRecord(Hashtable table, SqlDataReader reader)
        {
            GetReaderValue<int>(Fields.PostId, reader, table);
            GetReaderValue<decimal>(Fields.Average, reader, table);
        }

        public Hashtable GetByPostId(int postId)
        {
            SqlCommand cmd = CreateCommand("GetByPostId");
            AddInputParameter(cmd, "PostId", postId, SqlDbType.Int);
            return ExecuteGetItem(cmd);
        }
    }
}
